package com.xiaotu.spring.service;

import com.xinji.bean.XinJiBeanC;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanNameGenerator;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @author zhangxiao
 * @create 2021-11-12 15:52
 */
public class MyImportBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {

    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry, BeanNameGenerator importBeanNameGenerator) {
        final RootBeanDefinition xinJiBeanCBeanDefinition = new RootBeanDefinition(XinJiBeanC.class);
        registry.registerBeanDefinition("xinJiBeanC", xinJiBeanCBeanDefinition);
    }

}
